#ifndef NOACTIONBOX_H_JM_20130308
#define NOACTIONBOX_H_JM_20130308

#include "../RootBox.h"

namespace jm4bbx {

	class  NoActionBox : public RootBox {
	public:
		static const  groupType INPUT_GROUP;
		static const  groupType OUTPUT_GROUP;	
		static const  columnType INPUT_COLUMN;
		static const  columnType OUTPUT_COLUMN;
		static const  inType IN_ARC;
		static const  outType OUT_ARC;
		
		NoActionBox(const BoxParamPack& p) : RootBox(p) { }

		virtual void initImpl() {
			add_group(INPUT_GROUP, INPUT_COLUMN, 
				get_input_descriptors(IN_ARC));

			add_group(OUTPUT_GROUP, OUTPUT_COLUMN, 
				get_output_descriptors(OUT_ARC));

			wait4Receive();
		}

		virtual void syncMachEtwas() {
			// Nic nerobi rovno koniec.
			send_poisoned(OUT_ARC);
			sendSignalsOut(true);
			wait4Receive();
		}

	private:
		/// Zahajenie cakania na vstup.
		void wait4Receive() {
			receive(IN_ARC, INPUT_GROUP);
		}
	};

} // namespace jm4bbx


#endif
